package model

import (
	"gpt-api/framework/db"
	"time"
)

type Order struct {
	db.BaseModel
	OrderNo      string    `json:"order_no" gorm:"column:order_no;type:varchar(50);default:'';comment:订单号"`
	UserId       uint      `json:"user_id" gorm:"column:user_id;type:int;default:0;comment:用户ID"`
	TotalAmount  float64   `json:"total_amount" gorm:"column:total_amount;type:decimal(10,2);default:0;comment:订单总金额"`
	PayAmount    float64   `json:"pay_amount" gorm:"column:pay_amount;type:decimal(10,2);default:0;comment:实际支付金额"`
	PayTime      time.Time `json:"pay_time" gorm:"column:pay_time;default:null;comment:支付时间"`
	PayType      int       `json:"pay_type" gorm:"column:pay_type;type:int;default:0;comment:支付方式,1:微信支付,2:支付宝支付"`
	OrderStatus  int       `json:"order_status" gorm:"column:order_status;type:int;default:0;comment:订单状态,0:待支付,1:已支付,2:已取消"`
	OrderType    int       `json:"order_type" gorm:"column:order_type;type:int;default:0;comment:订单类型,1:充值买积分,2:余额买积分"`
	ExpireTime   time.Time `json:"expire_time" gorm:"column:expire_time;default:null;comment:订单过期时间"`
	OrderContent string    `json:"order_content" gorm:"column:order_content;type:text;default:'';comment:订单内容"`
}

func (Order) TableName() string {
	return "order"
}
